package com.zhuss.controller.car;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.car.car.CreateCarBo;
import com.zhuss.bean.bo.car.car.DeleteCarBo;
import com.zhuss.bean.bo.car.car.UpdateCarBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.car.car.CarOperateServiceExt;
import com.zhuss.exception.DzcxException;


/**
 * @description: 车辆操作的Controller
 * @author: zhushanshuo
 * @create: Fri Dec 18 20:35:18 CST 2020
 **/
@RestController
@RequestMapping("/car")
public class CarOperateController extends BaseController {
	
	@Autowired
	@Qualifier("carOperateService")
	private OperateService<Void, Object> carOperateService;
	
	@Autowired
	@Qualifier("carOperateServiceExt")
	private CarOperateServiceExt carOperateServiceExt;
	
	/**
	 * 创建
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateCarBo bo) throws DzcxException {
		
		carOperateService.create(bo);
    }
	
	
	/**
	 * 修改
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateCarBo bo) throws DzcxException {
		
		carOperateService.update(bo);
    }
	
	/**
	 * 删除
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteCarBo bo) throws DzcxException {
		
		carOperateService.delete(bo);
    }
	
}
